package com.example.warehouse.bus.dao.persist.repository.impl;

import com.example.warehouse.bus.dao.persist.mapper.BusSalesbackMapper;
import com.example.warehouse.bus.dao.persist.repository.IBusSalesbackRepository;
import com.example.warehouse.bus.pojo.param.BusSalesbackSelectParam;
import com.example.warehouse.bus.pojo.param.BusSalesbackUpdateParam;
import com.example.warehouse.bus.pojo.vo.BusSalesbackSelectVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 销售退货订单_数据层_实现类
 */
@Slf4j
@Repository
public class BusSalesbackRepositoryImpl implements IBusSalesbackRepository {

    @Autowired
    private BusSalesbackMapper busSalesbackMapper;

    public BusSalesbackRepositoryImpl() {
        log.info("创建控制器对象: BusSalesbackRepositoryImpl");
    }

    @Override
    public int insert(Long id, String description, Long idpipo) {
        log.debug("开始执行[新增_销售退货订单]的数据访问,参数:{},{},{}", id, description, idpipo);
        return busSalesbackMapper.insert(id, description, idpipo);
    }

    @Override
    public int delete(Long id, Long idpipo) {
        log.debug("开始执行[逻辑删除_销售退货订单]的数据访问,参数:{},{}", id, idpipo);
        return busSalesbackMapper.delete(id, idpipo);
    }

    @Override
    public int update(BusSalesbackUpdateParam busSalesbackUpdateParam, Long idpipo) {
        log.debug("开始执行[任意项更改_销售退货订单]的数据访问,参数:{},{}", busSalesbackUpdateParam, idpipo);
        return busSalesbackMapper.update(busSalesbackUpdateParam, idpipo);
    }

    @Override
    public int approvalSalesback(Long id, Integer approval, Long idpipo) {
        log.debug("开始执行[审批_销售退货订单]的数据访问,参数:{},{},{}", id, approval, idpipo);
        return busSalesbackMapper.approvalSalesback(id, approval, idpipo);
    }

    @Override
    public List<BusSalesbackSelectVO> select(BusSalesbackSelectParam busSalesbackSelectParam, Integer ignore, Integer pageSize) {
        log.debug("开始执行[分页模糊查询_销售退货订单_当前页面列表]的数据访问,参数:{},{},{}", busSalesbackSelectParam, ignore, pageSize);
        return busSalesbackMapper.select(busSalesbackSelectParam, ignore, pageSize);
    }

    @Override
    public Long count(BusSalesbackSelectParam busSalesbackSelectParam) {
        log.debug("开始执行[分页模糊查询_销售退货订单_结果总条数]的数据访问,参数:{}", busSalesbackSelectParam);
        return busSalesbackMapper.count(busSalesbackSelectParam);
    }
}
